import { network } from '@/utils';
import { TableListParams } from './data';

import { basic } from '../../../../../config/Apis';

export async function querySmallWhiteDetail(params: TableListParams) {
  return network.get(basic.xiaobai_account, {
    params,
  });
}

export async function queryLogisList(params: any) {
  params = {
    ...params,
    pageIndex: 1,
    pageSize: 20,
  };
  return network.get(basic.logis_list, {
    params,
  });
}

export async function operSaveOrDelNo(params: any) {
  return network.put(basic.xiaobai_device, { data: params });
}

export async function operSaveOrUpdate(params: any) {
  let requst: any = '';
  if (params.id) {
    requst = network.put(basic.xiaobai_account, { data: params });
  } else {
    requst = network.post(basic.xiaobai_account, { data: params });
  }
  return requst;
}
